package com.thinkTank.oa.configuration;

import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
@Component("springContextHolder")
public class SpringContextHolder implements ApplicationContextAware {
 
    private static ApplicationContext ctx = null;
 
  
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
    	//System.out.println("-------------------------------");
        ctx = applicationContext;
    }
 
    public static Object getBean( String beanName ) {
    	//System.out.println(ctx.toString());
        return ctx.getBean( beanName );
    }
}
 

